const getEle = (selector) => {
    return document.querySelector(selector);
}
const getEles = (selector) => {
    return document.querySelectorAll(selector);
}

export const getTime = (time) => {
    let d = new Date(time);
    const year = d.getFullYear();
    const month = d.getMonth() + 1;
    const date = d.getDate();
    const hour = d.getHours();
    const minute = d.getMinutes();
    const second = d.getSeconds();
    return `${year}-${month}-${date} ${hour}:${minute}:${second}`;
}

//命名导出
export { getEle,getEles }

//命名导出
// export const getEle = (selector) => {
//     return document.querySelector(selector);
// }
// export const getEles = (selector) => {
//     return document.querySelectorAll(selector);
// }

//默认导出(只能导出一个)
// export default getEle;